package com.dalei.vdsmanager.management.system.action;

import java.util.List;

import com.dalei.vdsmanager.security.dao.User;
import com.dalei.vdsmanager.security.service.UserService;
import com.opensymphony.xwork2.ActionSupport;

public class ListUserAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5226767161510868910L;
	
	private UserService userService;
	
	private List<User> users;

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public List<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		// return super.execute();
		users = userService.getUsers();
		if (users != null) {
			return SUCCESS;
		} else {
			return ERROR;
		}
	}
}
